home *** CD-ROM | disk | FTP | other *** search
Text File | 1997-09-11 | 2.0 KB | 78 lines | [TEXT/CWIE] |
- // InVecAccessor.h
- // accellerates searches on InVec indices
- // Copyright: © 1994 - 1996-1997 by Apple Computer, Inc., all rights reserved.
-
- #pragma once
- #ifndef InVecAccessor_h
- #define InVecAccessor_h
-
- #pragma import on
-
- #include "VectorAccessor.h"
- #include "InvertedAccessor.h"
- #include "InVecIndex.h"
-
- #pragma IA_BEGIN_EXPORTS
-
- class IAQuery;
-
- const uint32 InVecAccessorType = 'I&V0';
-
- class InVecAccessor : public InvertedAccessor, public VectorAccessor {
- public:
- InVecAccessor(InVecIndex** indices, uint32 indexCount, uint32 type = InVecAccessorType);
- ~InVecAccessor();
-
- uint32 RankedSearch(byte* textQuery, uint32 textQueryLen,
- RankedQueryDoc* docQuery, uint32 docQueryLen,
- RankedHit** results, uint32 resultLen,
- uint32 matchingTermsLen,
- RankedProgressFn* progressFn,
- clock_t progressFreq,
- void* appData);
-
- uint32 RankedSearch(IADocText* textQuery,
- RankedQueryDoc* docQuery, uint32 docQueryLen,
- RankedHit** results, uint32 resultLen,
- uint32 matchingTermsLen,
- RankedProgressFn* progressFn,
- clock_t progressFreq,
- void* appData);
-
- protected:
- void Initializing();
- void CacheTermStats(TermInfo** infos);
-
- IABlockSize InitsSize();
- void StoringInits(IAOutputBlock* output);
- void RestoringInits(IAInputBlock* input);
- void TrimQueryVector(TWVector* queryVector, byte* maxWeights);
- byte** GetTermMaxWeights() const;
- float* GetMaxWeightDecoder() const;
- float GetMaxWeightEncodingFactor() const;
-
- private:
- byte** termMaxWeights;
- float* maxWeightDecoder;
- float maxWeightEncodingFactor;
-
- void MakeMaxWeightCodec();
- };
-
- inline byte** InVecAccessor::GetTermMaxWeights() const
- {
- return termMaxWeights;
- }
- inline float* InVecAccessor::GetMaxWeightDecoder() const
- {
- return maxWeightDecoder;
- }
- inline float InVecAccessor::GetMaxWeightEncodingFactor() const
- {
- return maxWeightEncodingFactor;
- }
-
- #pragma IA_END_EXPORTS
-
- #pragma import reset
- #endif